<!doctype html>
<html lang="ru" data-bs-theme="dark">

<head>
    <!-- 2024-05-11 14:17:03 -->
        <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>git merge-base</title>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css" integrity="sha512-jnSuA4Ss2PkkikSOLtYs8BlYIeeIK1h99ty4YfvRPAlzr377vr3CXDb7sb7eEEBYjDtcYj+AjBH3FLv5uSJuXg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css" integrity="sha512-dPXYcDub/aeb08c63jRq/k6GaKccl256JQy/AnOq7CAnEZ9FzSL9wSbcZkMp4R26vBsMLFYH4kQ67/bbV8XaCQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css" integrity="sha512-rO+olRTkcf304DQBxSWxln8JXCzTHlKnIdnMUwYvQa9/Jd4cQaNkItIUj6Z4nvW1dqK0SKXLbn9h4KwZTNtAyw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/7.1.0/css/flag-icons.min.css" integrity="sha512-bZBu2H0+FGFz/stDN/L0k8J0G8qVsAL0ht1qg5kTwtAheiXwiRKyCq1frwfbSFSJN3jooR5kauE0YjtPzhZtJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link href="../../../runebook.css" rel="stylesheet" type="text/css">
    <meta name="x-github" content="https://github.com/runebookdev/runebook">
            <meta name="x-i18n-doc" content="git">
        <script>
        function i18n(element) {
            // NOP
        }
    </script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/3.0.5/js.cookie.js" integrity="sha512-F/dia2jKME12jwqiYDayeD+Rr/8jTWUD2wfbuJB0bzSwenSEnXsn4qQ/wVyXUCix5bmCAj8xJdtFr2OqUtjLAw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.bundle.min.js" integrity="sha512-7Pi/otdlbbCR+LnW+F7PwFcSDJOuUJB3OxtEHbg4vSMvzvJjde4Po1v4BR9Gdc9aXNUNFVUY+SK51wWT8WF0Gg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/7.8.1/rxjs.umd.min.js" integrity="sha512-D9LDs8YUUVa4V9Gl4Zb+xqRAc7RCzooR3+zzebgK2RMu/KU+dh90pbjEEMzPiSyRSGbSp9j1pZnrO4joGa5WEg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha512-mhbv5DqBMgrWL+32MmsDOt/OAvqr/cHimk6B8y/bx/xS88MVkYGPiVv2ixKVrkywF2qHplNRUvFsAHUdxZ3Krg==" crossorigin="anonymous"></script>
    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6424571640879890" crossorigin="anonymous"></script>    <script async src="https://www.googletagmanager.com/gtag/js?id=G-3G5BZ1QEDP"></script>
<script>
    window.dataLayer = window.dataLayer || [];

    function gtag() {
        dataLayer.push(arguments);
    }

    gtag('js', new Date());
    gtag('config', 'G-3G5BZ1QEDP');
</script>    <script>
(function(c, l, a, r, i, t, y) {
    c[a] = c[a] || function() {
        (c[a].q = c[a].q || []).push(arguments)
    };
    t = l.createElement(r);
    t.async = 1;
    t.src = "https://www.clarity.ms/tag/" + i + "?ref=bwt";
    y = l.getElementsByTagName(r)[0];
    y.parentNode.insertBefore(t, y);
})(window, document, "clarity", "script", "jto2hd94r9");
</script>    <script src="../../../theme.js"></script>
</head>

<body>
    <header class="bg-black">
        <div class="container">
            <div class="row">
                <div class="col">
                    <nav class="navbar navbar-expand-lg navbar-dark">
                        <a class="navbar-brand fw-bold" href="https://runebook.dev/ru">
                            <img alt="Runebook.dev" class="d-inline-block align-top mr-1" src="../../../assets/runebook_logo.webp" width="24" height="24">
                            Runebook.dev
                        </a>
                        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                            <span class="navbar-toggler-icon"></span>
                        </button>
                        <div class="collapse navbar-collapse" id="navbarSupportedContent">
                            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                                <li class="nav-item">
                                    <a class="nav-link" href="https://runebook.dev/ru#docs">Documentation</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="https://runebook.dev/contributors">Contributors</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="https://github.com/runebookdev/runebook/issues">GitHub</a>
                                </li>
                            </ul>
                                                                                                <button class="btn btn-success ms-2" id="showPopupButton">
                                        <i class="bi bi-translate"></i>
                                        Show English
                                    </button>
                                                                                        <div class="form-check form-switch ms-3">
                                <label class="text-light">
                                    <input class="form-check-input" type="checkbox" role="switch" id="theme-switch" checked>
                                    <i class="bi bi-moon-stars-fill"></i>
                                </label>
                            </div>
                        </div>
                    </nav>
                </div>
            </div>
        </div>
    </header>

    <!--sse-->
    <div class="container">
    <div class="row">
        <div class="col">
            <nav aria-label="breadcrumb" class="mt-2">
                <ol class="breadcrumb mb-1">
                    <li class="breadcrumb-item">
                        <a href="https://runebook.dev/ru#docs">
                            <span class="fi fi-ru"></span>                            Русский                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <a href="-index-.html">
                            Git                            2.43                        </a>
                    </li>
                                            <li class="breadcrumb-item">
                            <a href="-index-.html#Plumbing_Commands">
                                Plumbing Commands                            </a>
                        </li>
                                    </ol>
            </nav>
        </div>
    </div>
    <br>

    <div class="row">
        <div class="col-md-9">
            <main>
                <article>

                    
                    <h1 class="text-body-emphasis" ><span data-i18n="8c1c4761d3aaacbb83d916c6762c17680e5f33545a2105f839df3c1f5d4b8f5d/00" data-source="git-merge-base" onmousemove="i18n(this)">git-merge-base</span></h1> <h2 class="text-body-emphasis"  id="_name"><span data-i18n="dcd1d5223f73b3a965c07e3ff5dbee3eedcfedb806686a05b9b3868a2c3d6d50/3a" data-source="Name" onmousemove="i18n(this)">Name</span></h2> <div> <p><span data-i18n="6b1e1127376801e71d0c3b08756b050061846ec0663731efd93351a0bad9f4a3/65" data-source="git-merge-base - Find as good common ancestors as possible for a merge" onmousemove="i18n(this)">git-merge-base &mdash; &ncy;&acy;&jcy;&tcy;&icy; &kcy;&acy;&kcy; &mcy;&ocy;&zhcy;&ncy;&ocy; &bcy;&ocy;&lcy;&iecy;&iecy; &khcy;&ocy;&rcy;&ocy;&shcy;&icy;&khcy; &ocy;&bcy;&shchcy;&icy;&khcy; &pcy;&rcy;&iecy;&dcy;&kcy;&ocy;&vcy; &dcy;&lcy;&yacy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy;</span></p> </div> <h2 class="text-body-emphasis"  id="_synopsis"><span data-i18n="8eb3755381519d7f0479d75446e56e20084834c0460d7ec94926932372ea6c47/0d" data-source="Synopsis" onmousemove="i18n(this)">Synopsis</span></h2> <div> <div> <pre class="hljs language-sql">git <span class="hljs-keyword">merge</span><span class="hljs-operator">-</span>base [<span class="hljs-operator">-</span>a <span class="hljs-operator">|</span> <span class="hljs-comment" title="--all] &lt;commit&gt; &lt;commit&gt;&hellip;&ZeroWidthSpace;">--all] &lt;&fcy;&icy;&kcy;&scy;&acy;&tscy;&icy;&yacy;&gt; &lt;&fcy;&icy;&kcy;&scy;&acy;&tscy;&icy;&yacy;&gt;&hellip;&ZeroWidthSpace;</span>
git <span class="hljs-keyword">merge</span><span class="hljs-operator">-</span>base [<span class="hljs-operator">-</span>a <span class="hljs-operator">|</span> <span class="hljs-comment" title="--all] --octopus &lt;commit&gt;&hellip;&ZeroWidthSpace;">--all] --octopus &lt;&fcy;&icy;&kcy;&scy;&acy;&tscy;&icy;&yacy;&gt;&hellip;&ZeroWidthSpace;</span>
git <span class="hljs-keyword">merge</span><span class="hljs-operator">-</span>base <span class="hljs-comment" title="--is-ancestor &lt;commit&gt; &lt;commit&gt;">--is-ancestor &lt;&fcy;&icy;&kcy;&scy;&acy;&tscy;&icy;&yacy;&gt; &lt;&fcy;&icy;&kcy;&scy;&acy;&tscy;&icy;&yacy;&gt;</span>
git <span class="hljs-keyword">merge</span><span class="hljs-operator">-</span>base <span class="hljs-comment">--independent &lt;commit&gt;&hellip;&ZeroWidthSpace;</span>
git <span class="hljs-keyword">merge</span><span class="hljs-operator">-</span>base <span class="hljs-comment">--fork-point &lt;ref&gt; [&lt;commit&gt;]</span></pre> </div> </div> <h2 class="text-body-emphasis"  id="_description"><span data-i18n="526e0087cc3f254d9f86f6c7d8e23d954c4dfda2b312efc29194ae8a860106ba/d3" data-source="Description" onmousemove="i18n(this)">Description</span></h2> <div> <p><span data-i18n="c05635b9c81a4ff36b2e10e93fa0646751ce84d5fef6b128003b0bacbb00db51/94" data-source="&lt;code&gt;git merge-base&lt;/code&gt; finds the best common ancestor(s) between two commits to use in a three-way merge. One common ancestor is &lt;code&gt;better&lt;/code&gt; than another common ancestor if the latter is an ancestor of the former. A common ancestor that does not have any better common ancestor is a &lt;code&gt;best common ancestor&lt;/code&gt;, i.e. a &lt;code&gt;merge base&lt;/code&gt;. Note that there can be more than one merge base for a pair of commits." onmousemove="i18n(this)"><code>git merge-base</code>  &ncy;&acy;&khcy;&ocy;&dcy;&icy;&tcy; &ncy;&acy;&icy;&lcy;&ucy;&chcy;&shcy;&iecy;&gcy;&ocy; &ocy;&bcy;&shchcy;&iecy;&gcy;&ocy; &pcy;&rcy;&iecy;&dcy;&kcy;&acy; &mcy;&iecy;&zhcy;&dcy;&ucy; &dcy;&vcy;&ucy;&mcy;&yacy; &fcy;&icy;&kcy;&scy;&acy;&tscy;&icy;&yacy;&mcy;&icy; &dcy;&lcy;&yacy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&ncy;&icy;&yacy; &vcy; &tcy;&rcy;&iecy;&khcy;&scy;&tcy;&ocy;&rcy;&ocy;&ncy;&ncy;&iecy;&mcy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&icy;. &Ocy;&dcy;&icy;&ncy; &ocy;&bcy;&shchcy;&icy;&jcy; &pcy;&rcy;&iecy;&dcy;&ocy;&kcy; - &ecy;&tcy;&ocy;  <code>better</code> , &acy; &dcy;&rcy;&ucy;&gcy;&ocy;&jcy; &ocy;&bcy;&shchcy;&icy;&jcy; &pcy;&rcy;&iecy;&dcy;&ocy;&kcy;, &iecy;&scy;&lcy;&icy; &pcy;&ocy;&scy;&lcy;&iecy;&dcy;&ncy;&icy;&jcy; &yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy; &pcy;&rcy;&iecy;&dcy;&kcy;&ocy;&mcy; &pcy;&iecy;&rcy;&vcy;&ocy;&gcy;&ocy;. &Ocy;&bcy;&shchcy;&icy;&jcy; &pcy;&rcy;&iecy;&dcy;&ocy;&kcy;, &ucy; &kcy;&ocy;&tcy;&ocy;&rcy;&ocy;&gcy;&ocy; &ncy;&iecy;&tcy; &lcy;&ucy;&chcy;&shcy;&iecy;&gcy;&ocy; &ocy;&bcy;&shchcy;&iecy;&gcy;&ocy; &pcy;&rcy;&iecy;&dcy;&kcy;&acy;, &mdash; &ecy;&tcy;&ocy;  <code>best common ancestor</code> , &tcy;&ocy; &iecy;&scy;&tcy;&softcy;  <code>merge base</code> . &Ocy;&bcy;&rcy;&acy;&tcy;&icy;&tcy;&iecy; &vcy;&ncy;&icy;&mcy;&acy;&ncy;&icy;&iecy;, &chcy;&tcy;&ocy; &dcy;&lcy;&yacy; &pcy;&acy;&rcy;&ycy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy; &mcy;&ocy;&zhcy;&iecy;&tcy; &bcy;&ycy;&tcy;&softcy; &bcy;&ocy;&lcy;&iecy;&iecy; &ocy;&dcy;&ncy;&ocy;&jcy; &bcy;&acy;&zcy;&ycy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy;.</span></p> </div> <h2 class="text-body-emphasis"  id="_operation_modes"><span data-i18n="6bc5fc03d10922f99091d7965061d7ba2cf307bac5737a0f533a42bf24a99f5c/fb" data-source="Operation modes" onmousemove="i18n(this)">Operation modes</span></h2> <div> <p><span data-i18n="1d7faf5177c1b41e8543e4abbf7c2157a940d7441e9c4c467063c93b8f4dd912/39" data-source="In the most common special case, specifying only two commits on the command line means computing the merge base between the given two commits." onmousemove="i18n(this)">&Vcy; &ncy;&acy;&icy;&bcy;&ocy;&lcy;&iecy;&iecy; &rcy;&acy;&scy;&pcy;&rcy;&ocy;&scy;&tcy;&rcy;&acy;&ncy;&iecy;&ncy;&ncy;&ocy;&mcy; &chcy;&acy;&scy;&tcy;&ncy;&ocy;&mcy; &scy;&lcy;&ucy;&chcy;&acy;&iecy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;&icy;&iecy; &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &dcy;&vcy;&ucy;&khcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy; &vcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ncy;&ocy;&jcy; &scy;&tcy;&rcy;&ocy;&kcy;&iecy; &ocy;&zcy;&ncy;&acy;&chcy;&acy;&iecy;&tcy; &vcy;&ycy;&chcy;&icy;&scy;&lcy;&iecy;&ncy;&icy;&iecy; &bcy;&acy;&zcy;&ycy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy; &mcy;&iecy;&zhcy;&dcy;&ucy; &dcy;&acy;&ncy;&ncy;&ycy;&mcy;&icy; &dcy;&vcy;&ucy;&mcy;&yacy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&acy;&mcy;&icy;.</span></p> <p><span data-i18n="0ae9223a2408b8b5a49f1ee77a66e9d9b54bec9f49c0cdf275f23cf15baee115/cc" data-source="More generally, among the two commits to compute the merge base from, one is specified by the first commit argument on the command line; the other commit is a (possibly hypothetical) commit that is a merge across all the remaining commits on the command line." onmousemove="i18n(this)">&Vcy; &bcy;&ocy;&lcy;&iecy;&iecy; &ocy;&bcy;&shchcy;&iecy;&mcy; &scy;&mcy;&ycy;&scy;&lcy;&iecy;, &scy;&rcy;&iecy;&dcy;&icy; &dcy;&vcy;&ucy;&khcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy;, &ncy;&acy; &ocy;&scy;&ncy;&ocy;&vcy;&iecy; &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&khcy; &vcy;&ycy;&chcy;&icy;&scy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy; &bcy;&acy;&zcy;&acy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy;, &ocy;&dcy;&icy;&ncy; &ucy;&kcy;&acy;&zcy;&ycy;&vcy;&acy;&iecy;&tcy;&scy;&yacy; &pcy;&iecy;&rcy;&vcy;&ycy;&mcy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;&ocy;&mcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&acy; &vcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ncy;&ocy;&jcy; &scy;&tcy;&rcy;&ocy;&kcy;&iecy;; &dcy;&rcy;&ucy;&gcy;&ocy;&jcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy; &mdash; &ecy;&tcy;&ocy; (&vcy;&ocy;&zcy;&mcy;&ocy;&zhcy;&ncy;&ocy;, &gcy;&icy;&pcy;&ocy;&tcy;&iecy;&tcy;&icy;&chcy;&iecy;&scy;&kcy;&icy;&jcy;) &kcy;&ocy;&mcy;&mcy;&icy;&tcy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&jcy; &pcy;&rcy;&iecy;&dcy;&scy;&tcy;&acy;&vcy;&lcy;&yacy;&iecy;&tcy; &scy;&ocy;&bcy;&ocy;&jcy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&iecy; &vcy;&scy;&iecy;&khcy; &ocy;&scy;&tcy;&acy;&lcy;&softcy;&ncy;&ycy;&khcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy; &vcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ncy;&ocy;&jcy; &scy;&tcy;&rcy;&ocy;&kcy;&iecy;.</span></p> <p><span data-i18n="ad5a88e9a9327db3bab51d0f6a20e921d32108c4265dd08075bacfc210b866ba/9c" data-source="As a consequence, the &lt;code&gt;merge base&lt;/code&gt; is not necessarily contained in each of the commit arguments if more than two commits are specified. This is different from &lt;a href=&quot;git-show-branch&quot;&gt;git-show-branch[1]&lt;/a&gt; when used with the &lt;code&gt;--merge-base&lt;/code&gt; option." onmousemove="i18n(this)">&Kcy;&acy;&kcy; &scy;&lcy;&iecy;&dcy;&scy;&tcy;&vcy;&icy;&iecy;,  <code>merge base</code>  &ncy;&iecy; &ocy;&bcy;&yacy;&zcy;&acy;&tcy;&iecy;&lcy;&softcy;&ncy;&ocy; &scy;&ocy;&dcy;&iecy;&rcy;&zhcy;&icy;&tcy;&scy;&yacy; &vcy; &kcy;&acy;&zhcy;&dcy;&ocy;&mcy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;&iecy; &fcy;&icy;&kcy;&scy;&acy;&tscy;&icy;&icy;, &iecy;&scy;&lcy;&icy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;&ocy; &bcy;&ocy;&lcy;&iecy;&iecy; &dcy;&vcy;&ucy;&khcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy;. &Ocy;&ncy; &ocy;&tcy;&lcy;&icy;&chcy;&acy;&iecy;&tcy;&scy;&yacy; &ocy;&tcy;  <a href="git-show-branch.html">git-show-branch[1]</a>  &pcy;&rcy;&icy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&ncy;&icy;&icy; &scy; &ocy;&pcy;&tscy;&icy;&iecy;&jcy;  <code>--merge-base</code> .</span></p> <div> <dl> <dt id="Documentation/git-merge-base.txt---octopus"><span data-i18n="70cc4a2ab20a67c8999918832159335d6e99e16885ec460a340f49feeae735d2/7a" data-source="--octopus" onmousemove="i18n(this)">--octopus</span></dt> <dd> <p><span data-i18n="2e14854146a0f83003d0a7403cbd883476cb791aa63783552084f97a03a6f3ff/ea" data-source="Compute the best common ancestors of all supplied commits, in preparation for an n-way merge. This mimics the behavior of &lt;code&gt;git show-branch --merge-base&lt;/code&gt;." onmousemove="i18n(this)">&Vcy;&ycy;&chcy;&icy;&scy;&lcy;&icy;&tcy;&iecy; &lcy;&ucy;&chcy;&shcy;&icy;&khcy; &ocy;&bcy;&shchcy;&icy;&khcy; &pcy;&rcy;&iecy;&dcy;&kcy;&ocy;&vcy; &vcy;&scy;&iecy;&khcy; &pcy;&rcy;&iecy;&dcy;&ocy;&scy;&tcy;&acy;&vcy;&lcy;&iecy;&ncy;&ncy;&ycy;&khcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy; &dcy;&lcy;&yacy; &pcy;&ocy;&dcy;&gcy;&ocy;&tcy;&ocy;&vcy;&kcy;&icy; &kcy; n-&scy;&tcy;&ocy;&rcy;&ocy;&ncy;&ncy;&iecy;&mcy;&ucy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yucy;. &Ecy;&tcy;&ocy; &icy;&mcy;&icy;&tcy;&icy;&rcy;&ucy;&iecy;&tcy; &pcy;&ocy;&vcy;&iecy;&dcy;&iecy;&ncy;&icy;&iecy;  <code>git show-branch --merge-base</code> .</span></p> </dd> <dt id="Documentation/git-merge-base.txt---independent"><span data-i18n="f9dfe4dfe8daecc562a48c86187b8cdfba7e0747234f83df46e47d1cd287d12e/39" data-source="--independent" onmousemove="i18n(this)">--independent</span></dt> <dd> <p><span data-i18n="253391fc112948817a1efdaf6f11b0ffa2f512b3f74004f4d40df90af7a6cefb/23" data-source="Instead of printing merge bases, print a minimal subset of the supplied commits with the same ancestors. In other words, among the commits given, list those which cannot be reached from any other. This mimics the behavior of &lt;code&gt;git show-branch --independent&lt;/code&gt;." onmousemove="i18n(this)">&Vcy;&mcy;&iecy;&scy;&tcy;&ocy; &pcy;&iecy;&chcy;&acy;&tcy;&icy; &bcy;&acy;&zcy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy; &rcy;&acy;&scy;&pcy;&iecy;&chcy;&acy;&tcy;&acy;&jcy;&tcy;&iecy; &mcy;&icy;&ncy;&icy;&mcy;&acy;&lcy;&softcy;&ncy;&ocy;&iecy; &pcy;&ocy;&dcy;&mcy;&ncy;&ocy;&zhcy;&iecy;&scy;&tcy;&vcy;&ocy; &pcy;&rcy;&iecy;&dcy;&ocy;&scy;&tcy;&acy;&vcy;&lcy;&iecy;&ncy;&ncy;&ycy;&khcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy; &scy; &tcy;&iecy;&mcy;&icy; &zhcy;&iecy; &pcy;&rcy;&iecy;&dcy;&kcy;&acy;&mcy;&icy;. &Dcy;&rcy;&ucy;&gcy;&icy;&mcy;&icy; &scy;&lcy;&ocy;&vcy;&acy;&mcy;&icy;, &scy;&rcy;&iecy;&dcy;&icy; &dcy;&acy;&ncy;&ncy;&ycy;&khcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy; &pcy;&iecy;&rcy;&iecy;&chcy;&icy;&scy;&lcy;&icy;&tcy;&iecy; &tcy;&iecy;, &dcy;&ocy; &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&khcy; &ncy;&iecy;&vcy;&ocy;&zcy;&mcy;&ocy;&zhcy;&ncy;&ocy; &dcy;&ocy;&bcy;&rcy;&acy;&tcy;&softcy;&scy;&yacy; &ncy;&icy; &icy;&zcy; &ocy;&dcy;&ncy;&ocy;&gcy;&ocy; &dcy;&rcy;&ucy;&gcy;&ocy;&gcy;&ocy;. &Ecy;&tcy;&ocy; &icy;&mcy;&icy;&tcy;&icy;&rcy;&ucy;&iecy;&tcy; &pcy;&ocy;&vcy;&iecy;&dcy;&iecy;&ncy;&icy;&iecy;  <code>git show-branch --independent</code> .</span></p> </dd> <dt id="Documentation/git-merge-base.txt---is-ancestor"><span data-i18n="b6c8bfbcbf5f315473cd5c4f0c9ae4d06ff3856448add0e550d24d8f44b6f857/6e" data-source="--is-ancestor" onmousemove="i18n(this)">--is-ancestor</span></dt> <dd> <p><span data-i18n="9017b258434269b0773b1e5c7d3aff859ecf7ac16a96ff7d00212770118628cb/95" data-source="Check if the first &amp;lt;commit&amp;gt; is an ancestor of the second &amp;lt;commit&amp;gt;, and exit with status 0 if true, or with status 1 if not. Errors are signaled by a non-zero status that is not 1." onmousemove="i18n(this)">&Pcy;&rcy;&ocy;&vcy;&iecy;&rcy;&softcy;&tcy;&iecy;, &yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy; &lcy;&icy; &pcy;&iecy;&rcy;&vcy;&ycy;&jcy; &lt;commit&gt; &pcy;&rcy;&iecy;&dcy;&kcy;&ocy;&mcy; &vcy;&tcy;&ocy;&rcy;&ocy;&gcy;&ocy; &lt;commit&gt;, &icy; &vcy;&ycy;&jcy;&dcy;&icy;&tcy;&iecy; &scy;&ocy; &scy;&tcy;&acy;&tcy;&ucy;&scy;&ocy;&mcy; 0, &iecy;&scy;&lcy;&icy; &ecy;&tcy;&ocy; &pcy;&rcy;&acy;&vcy;&dcy;&acy;, &icy;&lcy;&icy; &scy;&ocy; &scy;&tcy;&acy;&tcy;&ucy;&scy;&ocy;&mcy; 1, &iecy;&scy;&lcy;&icy; &ncy;&iecy;&tcy;. &Ocy;&bcy; &ocy;&shcy;&icy;&bcy;&kcy;&acy;&khcy; &scy;&icy;&gcy;&ncy;&acy;&lcy;&icy;&zcy;&icy;&rcy;&ucy;&iecy;&tcy; &ncy;&iecy;&ncy;&ucy;&lcy;&iecy;&vcy;&ocy;&jcy; &scy;&tcy;&acy;&tcy;&ucy;&scy;, &ocy;&tcy;&lcy;&icy;&chcy;&ncy;&ycy;&jcy; &ocy;&tcy; 1.</span></p> </dd> <dt id="Documentation/git-merge-base.txt---fork-point"><span data-i18n="4e3b25cb1b587891c16fb19a477f52967120734759b8eb14182eb3eb0130f4d3/57" data-source="--fork-point" onmousemove="i18n(this)">--fork-point</span></dt> <dd> <p><span data-i18n="959343171f68dfca7d1f2532246a8c7c92658ca70394c66de9badcdfdf35566b/e9" data-source="Find the point at which a branch (or any history that leads to &amp;lt;commit&amp;gt;) forked from another branch (or any reference) &amp;lt;ref&amp;gt;. This does not just look for the common ancestor of the two commits, but also takes into account the reflog of &amp;lt;ref&amp;gt; to see if the history leading to &amp;lt;commit&amp;gt; forked from an earlier incarnation of the branch &amp;lt;ref&amp;gt; (see discussion of this mode below)." onmousemove="i18n(this)">&Ncy;&acy;&jcy;&dcy;&icy;&tcy;&iecy; &tcy;&ocy;&chcy;&kcy;&ucy;, &vcy; &kcy;&ocy;&tcy;&ocy;&rcy;&ocy;&jcy; &vcy;&iecy;&tcy;&vcy;&softcy; (&icy;&lcy;&icy; &lcy;&yucy;&bcy;&acy;&yacy; &icy;&scy;&tcy;&ocy;&rcy;&icy;&yacy;, &vcy;&iecy;&dcy;&ucy;&shchcy;&acy;&yacy; &kcy; &lt;commit&gt;) &ocy;&tcy;&dcy;&iecy;&lcy;&icy;&lcy;&acy;&scy;&softcy; &ocy;&tcy; &dcy;&rcy;&ucy;&gcy;&ocy;&jcy; &vcy;&iecy;&tcy;&kcy;&icy; (&icy;&lcy;&icy; &lcy;&yucy;&bcy;&ocy;&jcy; &scy;&scy;&ycy;&lcy;&kcy;&icy;) &lt;ref&gt;. &Pcy;&rcy;&icy; &ecy;&tcy;&ocy;&mcy; &ncy;&iecy; &pcy;&rcy;&ocy;&scy;&tcy;&ocy; &icy;&shchcy;&iecy;&tcy;&scy;&yacy; &ocy;&bcy;&shchcy;&icy;&jcy; &pcy;&rcy;&iecy;&dcy;&ocy;&kcy; &dcy;&vcy;&ucy;&khcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy;, &ncy;&ocy; &tcy;&acy;&kcy;&zhcy;&iecy; &ucy;&chcy;&icy;&tcy;&ycy;&vcy;&acy;&iecy;&tcy;&scy;&yacy; &rcy;&iecy;&fcy;&lcy;&ocy;&gcy; &lt;ref&gt;, &chcy;&tcy;&ocy;&bcy;&ycy; &ucy;&vcy;&icy;&dcy;&iecy;&tcy;&softcy;, &ncy;&iecy; &vcy;&ocy;&zcy;&ncy;&icy;&kcy;&lcy;&acy; &lcy;&icy; &icy;&scy;&tcy;&ocy;&rcy;&icy;&yacy;, &vcy;&iecy;&dcy;&ucy;&shchcy;&acy;&yacy; &kcy; &lt;commit&gt;, &ocy;&tcy; &bcy;&ocy;&lcy;&iecy;&iecy; &rcy;&acy;&ncy;&ncy;&iecy;&gcy;&ocy; &vcy;&ocy;&pcy;&lcy;&ocy;&shchcy;&iecy;&ncy;&icy;&yacy; &vcy;&iecy;&tcy;&kcy;&icy; &lt;ref&gt; (&scy;&mcy;. &ocy;&bcy;&scy;&ucy;&zhcy;&dcy;&iecy;&ncy;&icy;&iecy; &ecy;&tcy;&ocy;&tcy; &rcy;&iecy;&zhcy;&icy;&mcy; &ncy;&icy;&zhcy;&iecy;).</span></p> </dd> </dl> </div> </div> <h2 class="text-body-emphasis"  id="_options"><span data-i18n="d0db8b5e364b6989e4b8f38a2b3846b87d99a51c1592ebf35d21cc66405a8e39/b6" data-source="Options" onmousemove="i18n(this)">Options</span></h2> <div> <div> <dl> <dt id="Documentation/git-merge-base.txt--a"><span data-i18n="c274891790345c56cef3b53c026bdc48150948fa60c56306073d6fea7766ad6a/1a" data-source="-a" onmousemove="i18n(this)">-a</span></dt> <dt id="Documentation/git-merge-base.txt---all"><span data-i18n="7dbf56c38208e33a9193b210245465f7729af0d59b9df556e7f1f7138a6d6e93/a1" data-source="--all" onmousemove="i18n(this)">--all</span></dt> <dd> <p><span data-i18n="7191f3aa3bcf9c64c391069b6e1833aa881e6bbf12a0d4eb290cc74cbb30112e/48" data-source="Output all merge bases for the commits, instead of just one." onmousemove="i18n(this)">&Vcy;&ycy;&vcy;&iecy;&dcy;&icy;&tcy;&iecy; &vcy;&scy;&iecy; &bcy;&acy;&zcy;&ycy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy; &dcy;&lcy;&yacy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy; &vcy;&mcy;&iecy;&scy;&tcy;&ocy; &ocy;&dcy;&ncy;&ocy;&jcy;.</span></p> </dd> </dl> </div> </div> <h2 class="text-body-emphasis"  id="_discussion"><span data-i18n="5eb6cf647d2c5d14a044e2d103dcef4cf0cdc872434c374debc1043092bc4746/dd" data-source="Discussion" onmousemove="i18n(this)">Discussion</span></h2> <div> <p><span data-i18n="eea9f0a0a6559c8f20dc7e7d8100f37503ce05a0984765ac56188ee7ee8984f8/50" data-source="Given two commits &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt;, &lt;code&gt;git merge-base A B&lt;/code&gt; will output a commit which is reachable from both &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; through the parent relationship." onmousemove="i18n(this)">&Ucy;&chcy;&icy;&tcy;&ycy;&vcy;&acy;&yacy; &dcy;&vcy;&acy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&acy;  <code>A</code>  &icy;  <code>B</code>  ,  <code>git merge-base A B</code>  &vcy;&ycy;&vcy;&iecy;&dcy;&iecy;&tcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&jcy; &dcy;&ocy;&scy;&tcy;&ucy;&pcy;&iecy;&ncy; &kcy;&acy;&kcy; &icy;&zcy;  <code>A</code> , &tcy;&acy;&kcy; &icy; &icy;&zcy;  <code>B</code>  &chcy;&iecy;&rcy;&iecy;&zcy; &rcy;&ocy;&dcy;&icy;&tcy;&iecy;&lcy;&softcy;&scy;&kcy;&ocy;&iecy; &ocy;&tcy;&ncy;&ocy;&shcy;&iecy;&ncy;&icy;&iecy;.</span></p> <p><span data-i18n="429cc9a860f7ddfe40a4ff5d600aec4fcb44e8110e6aaa0c1063ae6ab40bb258/d9" data-source="For example, with this topology:" onmousemove="i18n(this)">&Ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;, &scy; &ecy;&tcy;&ocy;&jcy; &tcy;&ocy;&pcy;&ocy;&lcy;&ocy;&gcy;&icy;&iecy;&jcy;:</span></p> <div> <div> <pre class="hljs language-css">         o-<span class="hljs-attr">--o---o---B</span>
        /
-<span class="hljs-attr">--o---1---o---o---o---A</span></pre> </div> </div> <p><span data-i18n="8865ce482cdc1d1a803114ae28e7603874621588ae9f962f491aba43cce71b3d/eb" data-source="the merge base between &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; is &lt;code&gt;1&lt;/code&gt;." onmousemove="i18n(this)">&bcy;&acy;&zcy;&ocy;&jcy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy;  <code>A</code>  &icy;  <code>B</code>  &yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy;  <code>1</code> .</span></p> <p><span data-i18n="b0833d22cffed5ccff7e5944059e6c5aaf908d407db59ce6f6e1a3cc613b2334/1a" data-source="Given three commits &lt;code&gt;A&lt;/code&gt;, &lt;code&gt;B&lt;/code&gt;, and &lt;code&gt;C&lt;/code&gt;, &lt;code&gt;git merge-base A B C&lt;/code&gt; will compute the merge base between &lt;code&gt;A&lt;/code&gt; and a hypothetical commit &lt;code&gt;M&lt;/code&gt;, which is a merge between &lt;code&gt;B&lt;/code&gt; and &lt;code&gt;C&lt;/code&gt;. For example, with this topology:" onmousemove="i18n(this)">&Ucy;&chcy;&icy;&tcy;&ycy;&vcy;&acy;&yacy; &tcy;&rcy;&icy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&acy;  <code>A</code> ,  <code>B</code>  &icy;  <code>C</code> ,  <code>git merge-base A B C</code>  &vcy;&ycy;&chcy;&icy;&scy;&lcy;&icy;&tcy; &bcy;&acy;&zcy;&ucy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy; &mcy;&iecy;&zhcy;&dcy;&ucy;  <code>A</code>  &icy; &gcy;&icy;&pcy;&ocy;&tcy;&iecy;&tcy;&icy;&chcy;&iecy;&scy;&kcy;&icy;&mcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&mcy;  <code>M</code> , &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&jcy; &pcy;&rcy;&iecy;&dcy;&scy;&tcy;&acy;&vcy;&lcy;&yacy;&iecy;&tcy; &scy;&ocy;&bcy;&ocy;&jcy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&iecy;  <code>B</code>  &icy;  <code>C</code> . &Ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;, &scy; &ecy;&tcy;&ocy;&jcy; &tcy;&ocy;&pcy;&ocy;&lcy;&ocy;&gcy;&icy;&iecy;&jcy;:</span></p> <div> <div> <pre class="hljs language-css">       o-<span class="hljs-attr">--o---o---o---C</span>
      /
     /   o-<span class="hljs-attr">--o---o---B</span>
    /   /
---<span class="hljs-number">2</span>---<span class="hljs-number">1</span>-<span class="hljs-attr">--o---o---o---A</span></pre> </div> </div> <p><span data-i18n="941c9046068cc6d2740b0c78354d9e5a26d8f956dc7bb71e9fe0555cc62100df/bf" data-source="the result of &lt;code&gt;git merge-base A B C&lt;/code&gt; is &lt;code&gt;1&lt;/code&gt;. This is because the equivalent topology with a merge commit &lt;code&gt;M&lt;/code&gt; between &lt;code&gt;B&lt;/code&gt; and &lt;code&gt;C&lt;/code&gt; is:" onmousemove="i18n(this)">&rcy;&iecy;&zcy;&ucy;&lcy;&softcy;&tcy;&acy;&tcy;  <code>git merge-base A B C</code>  &mdash;  <code>1</code> . &Ecy;&tcy;&ocy; &scy;&vcy;&yacy;&zcy;&acy;&ncy;&ocy; &scy; &tcy;&iecy;&mcy;, &chcy;&tcy;&ocy; &ecy;&kcy;&vcy;&icy;&vcy;&acy;&lcy;&iecy;&ncy;&tcy;&ncy;&acy;&yacy; &tcy;&ocy;&pcy;&ocy;&lcy;&ocy;&gcy;&icy;&yacy; &scy; &fcy;&icy;&kcy;&scy;&acy;&tscy;&icy;&iecy;&jcy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy;  <code>M</code>  &mcy;&iecy;&zhcy;&dcy;&ucy;  <code>B</code>  &icy;  <code>C</code> :</span></p> <div> <div> <pre class="hljs language-css">       o-<span class="hljs-attr">--o---o---o---o</span>
      /                 \
     /   o-<span class="hljs-attr">--o---o---o---M</span>
    /   /
---<span class="hljs-number">2</span>---<span class="hljs-number">1</span>-<span class="hljs-attr">--o---o---o---A</span></pre> </div> </div> <p><span data-i18n="2e510b2d663ef4aeb33d421630f332a012f4b3124a4df906a490d29415357588/c6" data-source="and the result of &lt;code&gt;git merge-base A M&lt;/code&gt; is &lt;code&gt;1&lt;/code&gt;. Commit &lt;code&gt;2&lt;/code&gt; is also a common ancestor between &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;M&lt;/code&gt;, but &lt;code&gt;1&lt;/code&gt; is a better common ancestor, because &lt;code&gt;2&lt;/code&gt; is an ancestor of &lt;code&gt;1&lt;/code&gt;. Hence, &lt;code&gt;2&lt;/code&gt; is not a merge base." onmousemove="i18n(this)">&icy; &rcy;&iecy;&zcy;&ucy;&lcy;&softcy;&tcy;&acy;&tcy;  <code>git merge-base A M</code>  &mdash;  <code>1</code> . Commit  <code>2</code>  &tcy;&acy;&kcy;&zhcy;&iecy; &yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy; &ocy;&bcy;&shchcy;&icy;&mcy; &pcy;&rcy;&iecy;&dcy;&kcy;&ocy;&mcy; &mcy;&iecy;&zhcy;&dcy;&ucy;  <code>A</code>  &icy;  <code>M</code> , &ncy;&ocy;  <code>1</code>  &yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy; &lcy;&ucy;&chcy;&shcy;&icy;&mcy; &ocy;&bcy;&shchcy;&icy;&mcy; &pcy;&rcy;&iecy;&dcy;&kcy;&ocy;&mcy;, &pcy;&ocy;&scy;&kcy;&ocy;&lcy;&softcy;&kcy;&ucy;  <code>2</code>  &yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy; &pcy;&rcy;&iecy;&dcy;&kcy;&ocy;&mcy;  <code>1</code> . &Scy;&lcy;&iecy;&dcy;&ocy;&vcy;&acy;&tcy;&iecy;&lcy;&softcy;&ncy;&ocy;,  <code>2</code>  &ncy;&iecy; &yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy; &bcy;&acy;&zcy;&ocy;&jcy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy;.</span></p> <p><span data-i18n="d957139a8e20730d6bddbaf1db9a20cc10c83e1e93c064b91242815ed4c4e73b/09" data-source="The result of &lt;code&gt;git merge-base --octopus A B C&lt;/code&gt; is &lt;code&gt;2&lt;/code&gt;, because &lt;code&gt;2&lt;/code&gt; is the best common ancestor of all commits." onmousemove="i18n(this)">&Rcy;&iecy;&zcy;&ucy;&lcy;&softcy;&tcy;&acy;&tcy;&ocy;&mcy;  <code>git merge-base --octopus A B C</code>  &yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy;  <code>2</code> , &pcy;&ocy;&scy;&kcy;&ocy;&lcy;&softcy;&kcy;&ucy;  <code>2</code>  &mdash; &lcy;&ucy;&chcy;&shcy;&icy;&jcy; &ocy;&bcy;&shchcy;&icy;&jcy; &pcy;&rcy;&iecy;&dcy;&ocy;&kcy; &vcy;&scy;&iecy;&khcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy;.</span></p> <p><span data-i18n="bdc06b651b6c9e6c001eceaa1eef3febd672d3e83f5128dda75fddd2be30f74d/17" data-source="When the history involves criss-cross merges, there can be more than one &lt;code&gt;best&lt;/code&gt; common ancestor for two commits. For example, with this topology:" onmousemove="i18n(this)">&Kcy;&ocy;&gcy;&dcy;&acy; &icy;&scy;&tcy;&ocy;&rcy;&icy;&yacy; &vcy;&kcy;&lcy;&yucy;&chcy;&acy;&iecy;&tcy; &pcy;&iecy;&rcy;&iecy;&kcy;&rcy;&iecy;&scy;&tcy;&ncy;&ycy;&iecy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy;, &dcy;&lcy;&yacy; &dcy;&vcy;&ucy;&khcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy; &mcy;&ocy;&zhcy;&iecy;&tcy; &bcy;&ycy;&tcy;&softcy; &bcy;&ocy;&lcy;&iecy;&iecy; &ocy;&dcy;&ncy;&ocy;&gcy;&ocy; &ocy;&bcy;&shchcy;&iecy;&gcy;&ocy; &pcy;&rcy;&iecy;&dcy;&kcy;&acy;  <code>best</code> . &Ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;, &scy; &ecy;&tcy;&ocy;&jcy; &tcy;&ocy;&pcy;&ocy;&lcy;&ocy;&gcy;&icy;&iecy;&jcy;:</span></p> <div> <div> <pre class="hljs language-css">---<span class="hljs-number">1</span>-<span class="hljs-attr">--o---A</span>
    \ /
     X
    / \
---<span class="hljs-number">2</span>-<span class="hljs-attr">--o---o---B</span></pre> </div> </div> <p><span data-i18n="cf143ac4b40dd896d0eff96669cb8a376b44cee8eadb60444784374a89b4bea2/53" data-source="both &lt;code&gt;1&lt;/code&gt; and &lt;code&gt;2&lt;/code&gt; are merge bases of A and B. Neither one is better than the other (both are &lt;code&gt;best&lt;/code&gt; merge bases). When the &lt;code&gt;--all&lt;/code&gt; option is not given, it is unspecified which best one is output." onmousemove="i18n(this)">&icy;  <code>1</code> , &icy;  <code>2</code>  &yacy;&vcy;&lcy;&yacy;&yucy;&tcy;&scy;&yacy; &bcy;&acy;&zcy;&acy;&mcy;&icy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy; A &icy; B. &Ncy;&icy; &ocy;&dcy;&ncy;&acy; &icy;&zcy; &ncy;&icy;&khcy; &ncy;&iecy; &lcy;&ucy;&chcy;&shcy;&iecy; &dcy;&rcy;&ucy;&gcy;&ocy;&jcy; (&ocy;&bcy;&acy; &yacy;&vcy;&lcy;&yacy;&yucy;&tcy;&scy;&yacy; &bcy;&acy;&zcy;&acy;&mcy;&icy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy;  <code>best</code> ). &IEcy;&scy;&lcy;&icy; &ocy;&pcy;&tscy;&icy;&yacy;  <code>--all</code>  &ncy;&iecy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;&acy;, &ncy;&iecy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;&ocy;, &kcy;&acy;&kcy;&ocy;&jcy; &icy;&zcy; &ncy;&icy;&khcy; &bcy;&ucy;&dcy;&iecy;&tcy; &lcy;&ucy;&chcy;&shcy;&icy;&mcy;.</span></p> <p><span data-i18n="55146b673a516dfc0460710d5dc07729123bdfcc0d464b7685be62ed889cc7e7/3a" data-source="A common idiom to check &amp;quot;fast-forward-ness&amp;quot; between two commits A and B is (or at least used to be) to compute the merge base between A and B, and check if it is the same as A, in which case, A is an ancestor of B. You will see this idiom used often in older scripts." onmousemove="i18n(this)">&Rcy;&acy;&scy;&pcy;&rcy;&ocy;&scy;&tcy;&rcy;&acy;&ncy;&iecy;&ncy;&ncy;&ocy;&jcy; &icy;&dcy;&icy;&ocy;&mcy;&ocy;&jcy; &pcy;&rcy;&ocy;&vcy;&iecy;&rcy;&kcy;&icy;  &quot;fast-forward-ness&quot;  &mcy;&iecy;&zhcy;&dcy;&ucy; &dcy;&vcy;&ucy;&mcy;&yacy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&acy;&mcy;&icy; A &icy; B &yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy; (&icy;&lcy;&icy;, &pcy;&ocy; &kcy;&rcy;&acy;&jcy;&ncy;&iecy;&jcy; &mcy;&iecy;&rcy;&iecy;, &rcy;&acy;&ncy;&softcy;&shcy;&iecy;) &vcy;&ycy;&chcy;&icy;&scy;&lcy;&iecy;&ncy;&icy;&iecy; &bcy;&acy;&zcy;&ycy; &scy;&lcy;&icy;&yacy;&ncy;&icy;&yacy; &mcy;&iecy;&zhcy;&dcy;&ucy; A &icy; B &icy; &pcy;&rcy;&ocy;&vcy;&iecy;&rcy;&kcy;&acy;, &scy;&ocy;&vcy;&pcy;&acy;&dcy;&acy;&iecy;&tcy; &lcy;&icy; &ocy;&ncy;&acy; &scy; A, &icy; &vcy; &ecy;&tcy;&ocy;&mcy; &scy;&lcy;&ucy;&chcy;&acy;&iecy; A &yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy; &pcy;&rcy;&iecy;&dcy;&kcy;&ocy;&mcy; &Bcy;. &Vcy;&ycy; &ucy;&vcy;&icy;&dcy;&icy;&tcy;&iecy;, &chcy;&tcy;&ocy; &ecy;&tcy;&acy; &icy;&dcy;&icy;&ocy;&mcy;&acy; &chcy;&acy;&scy;&tcy;&ocy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&iecy;&tcy;&scy;&yacy; &vcy; &scy;&tcy;&acy;&rcy;&ycy;&khcy; &scy;&tscy;&iecy;&ncy;&acy;&rcy;&icy;&yacy;&khcy;.</span></p> <div> <div> <pre class="hljs language-bash">A=$(git rev-parse --verify A)
<span class="hljs-keyword">if</span> <span class="hljs-built_in">test</span> <span class="hljs-string">&quot;<span class="hljs-variable">$A</span>&quot;</span> = <span class="hljs-string">&quot;<span class="hljs-subst">$(git merge-base A B)</span>&quot;</span>
<span class="hljs-keyword">then</span>
        ... A is an ancestor of B ...
<span class="hljs-keyword">fi</span></pre> </div> </div> <p><span data-i18n="bc1d69b0b34eb2b0d5b9a73c1d45e226660f9b262a53b79ef74d2c98c4dd1c92/31" data-source="In modern git, you can say this in a more direct way:" onmousemove="i18n(this)">&Vcy; &scy;&ocy;&vcy;&rcy;&iecy;&mcy;&iecy;&ncy;&ncy;&ocy;&mcy; git &ecy;&tcy;&ocy; &mcy;&ocy;&zhcy;&ncy;&ocy; &scy;&kcy;&acy;&zcy;&acy;&tcy;&softcy; &bcy;&ocy;&lcy;&iecy;&iecy; &pcy;&rcy;&yacy;&mcy;&ocy;:</span></p> <div> <div> <pre class="hljs language-css">if git merge-base <span class="hljs-attr">--is-ancestor</span> <span class="hljs-selector-tag">A</span> <span class="hljs-selector-tag">B</span>
then
        ... <span class="hljs-selector-tag">A</span> is an ancestor of <span class="hljs-selector-tag">B</span> ...
fi</pre> </div> </div> <p><span data-i18n="90b5d13011f6a86532541bbf1ec3c2c9f09d654e267e4e889db77b09b8bbb990/74" data-source="instead." onmousemove="i18n(this)">instead.</span></p> </div> <h2 class="text-body-emphasis"  id="_discussion_on_fork_point_mode"><span data-i18n="b134a10fd3157d7997807e6f16809f1a7b9a0aff373a2fe13adf29cec7f5b2f7/32" data-source="Discussion on fork-point mode" onmousemove="i18n(this)">&Ocy;&bcy;&scy;&ucy;&zhcy;&dcy;&iecy;&ncy;&icy;&iecy; &rcy;&iecy;&zhcy;&icy;&mcy;&acy; &rcy;&acy;&zcy;&vcy;&iecy;&tcy;&vcy;&lcy;&iecy;&ncy;&icy;&yacy;</span></h2> <div> <p><span data-i18n="3921fc7e0b3ee5e3468be8616aaf26ac2b486a4c357e457f26f0dbd0ddf8b0c9/7e" data-source="After working on the &lt;code&gt;topic&lt;/code&gt; branch created with &lt;code&gt;git switch -c
topic origin/master&lt;/code&gt;, the history of remote-tracking branch &lt;code&gt;origin/master&lt;/code&gt; may have been rewound and rebuilt, leading to a history of this shape:" onmousemove="i18n(this)">&Pcy;&ocy;&scy;&lcy;&iecy; &rcy;&acy;&bcy;&ocy;&tcy;&ycy; &ncy;&acy;&dcy; &vcy;&iecy;&tcy;&kcy;&ocy;&jcy;  <code>topic</code> , &scy;&ocy;&zcy;&dcy;&acy;&ncy;&ncy;&ocy;&jcy; &scy; &pcy;&ocy;&mcy;&ocy;&shchcy;&softcy;&yucy;  <code>git switch -c
topic origin/master</code> , &icy;&scy;&tcy;&ocy;&rcy;&icy;&yacy; &vcy;&iecy;&tcy;&kcy;&icy; &ucy;&dcy;&acy;&lcy;&iecy;&ncy;&ncy;&ocy;&gcy;&ocy; &ocy;&tcy;&scy;&lcy;&iecy;&zhcy;&icy;&vcy;&acy;&ncy;&icy;&yacy;  <code>origin/master</code>  &mcy;&ocy;&gcy;&lcy;&acy; &bcy;&ycy;&tcy;&softcy; &pcy;&iecy;&rcy;&iecy;&mcy;&ocy;&tcy;&acy;&ncy;&acy; &icy; &pcy;&iecy;&rcy;&iecy;&scy;&tcy;&rcy;&ocy;&iecy;&ncy;&acy;, &chcy;&tcy;&ocy; &pcy;&rcy;&icy;&vcy;&iecy;&lcy;&ocy; &kcy; &icy;&scy;&tcy;&ocy;&rcy;&icy;&icy; &tcy;&acy;&kcy;&ocy;&jcy; &fcy;&ocy;&rcy;&mcy;&ycy;:</span></p> <div> <div> <pre class="hljs language-css">                 o-<span class="hljs-attr">--B2</span>
                /
-<span class="hljs-attr">--o---o---B1--o---o---o---B</span> (origin/master)
        \
         B0
          \
           D0-<span class="hljs-attr">--D1---D</span> (topic)</pre> </div> </div> <p><span data-i18n="6c24e1629ac9b310d613f68535963a75a6bc347f209ffb83ed288373c322e64a/7d" data-source="where &lt;code&gt;origin/master&lt;/code&gt; used to point at commits B0, B1, B2 and now it points at B, and your &lt;code&gt;topic&lt;/code&gt; branch was started on top of it back when &lt;code&gt;origin/master&lt;/code&gt; was at B0, and you built three commits, D0, D1, and D, on top of it. Imagine that you now want to rebase the work you did on the topic on top of the updated origin/master." onmousemove="i18n(this)">&gcy;&dcy;&iecy;  <code>origin/master</code>  &rcy;&acy;&ncy;&softcy;&shcy;&iecy; &ucy;&kcy;&acy;&zcy;&ycy;&vcy;&acy;&lcy; &ncy;&acy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ycy; B0, B1, B2, &acy; &tcy;&iecy;&pcy;&iecy;&rcy;&softcy; &ucy;&kcy;&acy;&zcy;&ycy;&vcy;&acy;&iecy;&tcy; &ncy;&acy; B, &icy; &vcy;&acy;&shcy;&acy; &vcy;&iecy;&tcy;&kcy;&acy;  <code>topic</code>  &bcy;&ycy;&lcy;&acy; &zcy;&acy;&pcy;&ucy;&shchcy;&iecy;&ncy;&acy; &pcy;&ocy;&vcy;&iecy;&rcy;&khcy; &ncy;&iecy;&iecy; &iecy;&shchcy;&iecy; &tcy;&ocy;&gcy;&dcy;&acy;, &kcy;&ocy;&gcy;&dcy;&acy;  <code>origin/master</code>  &bcy;&ycy;&lcy; &ncy;&acy; B0, &icy; &vcy;&ycy; &scy;&ocy;&zcy;&dcy;&acy;&lcy;&icy; &tcy;&rcy;&icy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&acy;, D0, D1 &icy; D, &ncy;&acy; &scy;&acy;&mcy;&ocy;&iecy; &vcy;&iecy;&rcy;&khcy;&ncy;&iecy;&iecy;. &Pcy;&rcy;&iecy;&dcy;&scy;&tcy;&acy;&vcy;&softcy;&tcy;&iecy;, &chcy;&tcy;&ocy; &tcy;&iecy;&pcy;&iecy;&rcy;&softcy; &vcy;&ycy; &khcy;&ocy;&tcy;&icy;&tcy;&iecy; &pcy;&iecy;&rcy;&iecy;&ncy;&iecy;&scy;&tcy;&icy; &rcy;&acy;&bcy;&ocy;&tcy;&ucy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ucy;&yucy; &vcy;&ycy; &pcy;&rcy;&ocy;&dcy;&iecy;&lcy;&acy;&lcy;&icy; &pcy;&ocy; &tcy;&iecy;&mcy;&iecy;, &pcy;&ocy;&vcy;&iecy;&rcy;&khcy; &ocy;&bcy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&ncy;&ocy;&gcy;&ocy; &icy;&scy;&tcy;&ocy;&chcy;&ncy;&icy;&kcy;&acy;/&mcy;&acy;&scy;&tcy;&iecy;&rcy;&acy;.</span></p> <p><span data-i18n="2fad26ca476b14fd468da57c13c2424cad611b05d4fdd7a459219efd97e991ae/12" data-source="In such a case, &lt;code&gt;git merge-base origin/master topic&lt;/code&gt; would return the parent of B0 in the above picture, but B0^..D is &lt;strong&gt;not&lt;/strong&gt; the range of commits you would want to replay on top of B (it includes B0, which is not what you wrote; it is a commit the other side discarded when it moved its tip from B0 to B1)." onmousemove="i18n(this)">&Vcy; &tcy;&acy;&kcy;&ocy;&mcy; &scy;&lcy;&ucy;&chcy;&acy;&iecy;  <code>git merge-base origin/master topic</code>  &vcy;&iecy;&rcy;&ncy;&iecy;&tcy; &rcy;&ocy;&dcy;&icy;&tcy;&iecy;&lcy;&yacy; B0 &ncy;&acy; &rcy;&icy;&scy;&ucy;&ncy;&kcy;&iecy; &vcy;&ycy;&shcy;&iecy;, &ncy;&ocy; B0^..D &mdash; &ecy;&tcy;&ocy; &ncy;&iecy; &tcy;&ocy;&tcy; &dcy;&icy;&acy;&pcy;&acy;&zcy;&ocy;&ncy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&jcy; &vcy;&ycy; &khcy;&ocy;&tcy;&iecy;&lcy;&icy; &bcy;&ycy; &vcy;&ocy;&scy;&pcy;&rcy;&ocy;&icy;&zcy;&vcy;&iecy;&scy;&tcy;&icy; &pcy;&ocy;&vcy;&iecy;&rcy;&khcy; B (&ocy;&ncy; &vcy;&kcy;&lcy;&yucy;&chcy;&acy;&iecy;&tcy; B0, &acy; &ecy;&tcy;&ocy; &ncy;&iecy; &tcy;&ocy;, &chcy;&tcy;&ocy; &vcy;&ycy; &ncy;&acy;&pcy;&icy;&scy;&acy;&lcy;&icy;; &ecy;&tcy;&ocy; &fcy;&icy;&kcy;&scy;&acy;&tscy;&icy;&yacy;, &ocy;&tcy;&bcy;&rcy;&ocy;&shcy;&iecy;&ncy;&ncy;&acy;&yacy; &dcy;&rcy;&ucy;&gcy;&ocy;&jcy; &scy;&tcy;&ocy;&rcy;&ocy;&ncy;&ocy;&jcy; &pcy;&rcy;&icy; &pcy;&iecy;&rcy;&iecy;&mcy;&iecy;&shchcy;&iecy;&ncy;&icy;&icy; &kcy;&ocy;&ncy;&chcy;&icy;&kcy;&acy; &scy; B0 &ncy;&acy; B1).</span></p> <p><span data-i18n="2fd54e83e822cbff5271600b4ec79ba370e5ea757484403954d9b35a981dd746/7e" data-source="&lt;code&gt;git merge-base --fork-point origin/master topic&lt;/code&gt; is designed to help in such a case. It takes not only B but also B0, B1, and B2 (i.e. old tips of the remote-tracking branches your repository&amp;rsquo;s reflog knows about) into account to see on which commit your topic branch was built and finds B0, allowing you to replay only the commits on your topic, excluding the commits the other side later discarded." onmousemove="i18n(this)"><code>git merge-base --fork-point origin/master topic</code>  &pcy;&rcy;&icy;&zcy;&vcy;&acy;&ncy; &pcy;&ocy;&mcy;&ocy;&chcy;&softcy; &vcy; &tcy;&acy;&kcy;&ocy;&mcy; &scy;&lcy;&ucy;&chcy;&acy;&iecy;. &Ocy;&ncy; &pcy;&rcy;&icy;&ncy;&icy;&mcy;&acy;&iecy;&tcy; &vcy;&ocy; &vcy;&ncy;&icy;&mcy;&acy;&ncy;&icy;&iecy; &ncy;&iecy; &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; B, &ncy;&ocy; &tcy;&acy;&kcy;&zhcy;&iecy; B0, B1 &icy; B2 (&tcy;. &iecy;. &scy;&tcy;&acy;&rcy;&ycy;&iecy; &pcy;&ocy;&dcy;&scy;&kcy;&acy;&zcy;&kcy;&icy; &vcy;&iecy;&tcy;&vcy;&iecy;&jcy; &ucy;&dcy;&acy;&lcy;&iecy;&ncy;&ncy;&ocy;&gcy;&ocy; &ocy;&tcy;&scy;&lcy;&iecy;&zhcy;&icy;&vcy;&acy;&ncy;&icy;&yacy;, &ocy; &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&khcy; &zcy;&ncy;&acy;&iecy;&tcy; &rcy;&iecy;&fcy;&lcy;&ocy;&gcy; &vcy;&acy;&shcy;&iecy;&gcy;&ocy; &rcy;&iecy;&pcy;&ocy;&zcy;&icy;&tcy;&ocy;&rcy;&icy;&yacy;), &chcy;&tcy;&ocy;&bcy;&ycy; &ucy;&vcy;&icy;&dcy;&iecy;&tcy;&softcy;, &ncy;&acy; &kcy;&acy;&kcy;&ocy;&mcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&iecy; &bcy;&ycy;&lcy;&acy; &pcy;&ocy;&scy;&tcy;&rcy;&ocy;&iecy;&ncy;&acy; &vcy;&acy;&shcy;&acy; &tcy;&iecy;&mcy;&acy;&tcy;&icy;&chcy;&iecy;&scy;&kcy;&acy;&yacy; &vcy;&iecy;&tcy;&kcy;&acy;, &icy; &ncy;&acy;&khcy;&ocy;&dcy;&icy;&tcy; B0, &pcy;&ocy;&zcy;&vcy;&ocy;&lcy;&yacy;&yacy; &vcy;&acy;&mcy; &vcy;&ocy;&scy;&pcy;&rcy;&ocy;&icy;&zcy;&vcy;&ocy;&dcy;&icy;&tcy;&softcy; &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ycy; &pcy;&ocy; &vcy;&acy;&shcy;&iecy;&jcy; &tcy;&iecy;&mcy;&iecy;, &zcy;&acy; &icy;&scy;&kcy;&lcy;&yucy;&chcy;&iecy;&ncy;&icy;&iecy;&mcy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &dcy;&rcy;&ucy;&gcy;&acy;&yacy; &scy;&tcy;&ocy;&rcy;&ocy;&ncy;&acy; &pcy;&ocy;&zcy;&zhcy;&iecy; &ocy;&tcy;&bcy;&rcy;&ocy;&scy;&icy;&lcy;&acy;.</span></p> <p><span data-i18n="fabbb0b657ffa104800038fae94199066dba6d16ddd979944915f856858c92d6/66" data-source="Hence" onmousemove="i18n(this)">Hence</span></p> <div> <div> <pre class="hljs language-makefile">$ fork_point=<span class="hljs-variable">$(git merge-base --fork-point <span class="hljs-built_in">origin</span>/master topic)</span></pre> </div> </div> <p><span data-i18n="68f8525fc8dee3dc191d791c8f1171ff8c6f6139827fb2775461b12512246806/68" data-source="will find B0, and" onmousemove="i18n(this)">&ncy;&acy;&jcy;&dcy;&iecy;&tcy; B0, &icy;</span></p> <div> <div> <pre class="hljs language-shell"><span class="hljs-meta prompt_">$ </span><span class="language-bash">git rebase --onto origin/master <span class="hljs-variable">$fork_point</span> topic</span></pre> </div> </div> <p><span data-i18n="359b9496bd62ba9ce73297034f039d3a117c69016a1e1b196e5e75bbed9ea5db/50" data-source="will replay D0, D1, and D on top of B to create a new history of this shape:" onmousemove="i18n(this)">&bcy;&ucy;&dcy;&iecy;&tcy; &vcy;&ocy;&scy;&pcy;&rcy;&ocy;&icy;&zcy;&vcy;&ocy;&dcy;&icy;&tcy;&softcy; D0, D1 &icy; D &pcy;&ocy;&vcy;&iecy;&rcy;&khcy; B, &chcy;&tcy;&ocy;&bcy;&ycy; &scy;&ocy;&zcy;&dcy;&acy;&tcy;&softcy; &ncy;&ocy;&vcy;&ucy;&yucy; &icy;&scy;&tcy;&ocy;&rcy;&icy;&yucy; &ecy;&tcy;&ocy;&jcy; &fcy;&ocy;&rcy;&mcy;&ycy;:</span></p> <div> <div> <pre class="hljs language-lua">                 o<span class="hljs-comment">---B2</span>
                /
<span class="hljs-comment">---o---o---B1--o---o---o---B (origin/master)</span>
        \                   \
         B0                  D0<span class="hljs-string">&apos;--D1&apos;</span><span class="hljs-comment" title="--D&apos; (topic - updated)">--D&apos; (&tcy;&iecy;&mcy;&acy; - &ocy;&bcy;&ncy;&ocy;&vcy;&lcy;&iecy;&ncy;&acy;)</span>
          \
           D0<span class="hljs-comment" title="---D1---D (topic - old)">---D1---D (&tcy;&iecy;&mcy;&acy; - &scy;&tcy;&acy;&rcy;&acy;&yacy;)</span></pre> </div> </div> <p><span data-i18n="c87c33e594d4aedb63a4949409598f7cf8ef3842319bc3fb8b63c525594a4c7a/61" data-source="A caveat is that older reflog entries in your repository may be expired by &lt;code&gt;git gc&lt;/code&gt;. If B0 no longer appears in the reflog of the remote-tracking branch &lt;code&gt;origin/master&lt;/code&gt;, the &lt;code&gt;--fork-point&lt;/code&gt; mode obviously cannot find it and fails, avoiding to give a random and useless result (such as the parent of B0, like the same command without the &lt;code&gt;--fork-point&lt;/code&gt; option gives)." onmousemove="i18n(this)">&Pcy;&rcy;&iecy;&dcy;&ocy;&scy;&tcy;&iecy;&rcy;&iecy;&zhcy;&iecy;&ncy;&icy;&iecy;: &scy;&rcy;&ocy;&kcy; &dcy;&iecy;&jcy;&scy;&tcy;&vcy;&icy;&yacy; &scy;&tcy;&acy;&rcy;&ycy;&khcy; &zcy;&acy;&pcy;&icy;&scy;&iecy;&jcy; &zhcy;&ucy;&rcy;&ncy;&acy;&lcy;&acy; &rcy;&iecy;&pcy;&ocy;&zcy;&icy;&tcy;&ocy;&rcy;&icy;&yacy; &vcy; &vcy;&acy;&shcy;&iecy;&mcy; &rcy;&iecy;&pcy;&ocy;&zcy;&icy;&tcy;&ocy;&rcy;&icy;&icy; &mcy;&ocy;&zhcy;&iecy;&tcy; &icy;&scy;&tcy;&iecy;&kcy;&acy;&tcy;&softcy; &kcy; &mcy;&ocy;&mcy;&iecy;&ncy;&tcy;&ucy;  <code>git gc</code> . &IEcy;&scy;&lcy;&icy; B0 &bcy;&ocy;&lcy;&softcy;&shcy;&iecy; &ncy;&iecy; &pcy;&ocy;&yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy; &vcy; &rcy;&iecy;&fcy;&lcy;&ocy;&gcy;&iecy; &vcy;&iecy;&tcy;&kcy;&icy; &ucy;&dcy;&acy;&lcy;&iecy;&ncy;&ncy;&ocy;&gcy;&ocy; &ocy;&tcy;&scy;&lcy;&iecy;&zhcy;&icy;&vcy;&acy;&ncy;&icy;&yacy;  <code>origin/master</code> , &rcy;&iecy;&zhcy;&icy;&mcy;  <code>--fork-point</code> , &ocy;&chcy;&iecy;&vcy;&icy;&dcy;&ncy;&ocy;, &ncy;&iecy; &mcy;&ocy;&zhcy;&iecy;&tcy; &iecy;&gcy;&ocy; &ncy;&acy;&jcy;&tcy;&icy; &icy; &zcy;&acy;&vcy;&iecy;&rcy;&shcy;&acy;&iecy;&tcy;&scy;&yacy; &scy;&bcy;&ocy;&iecy;&mcy;, &icy;&zcy;&bcy;&iecy;&gcy;&acy;&yacy; &vcy;&ycy;&dcy;&acy;&chcy;&icy; &scy;&lcy;&ucy;&chcy;&acy;&jcy;&ncy;&ocy;&gcy;&ocy; &icy; &bcy;&iecy;&scy;&pcy;&ocy;&lcy;&iecy;&zcy;&ncy;&ocy;&gcy;&ocy; &rcy;&iecy;&zcy;&ucy;&lcy;&softcy;&tcy;&acy;&tcy;&acy; (&ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;, &rcy;&ocy;&dcy;&icy;&tcy;&iecy;&lcy;&softcy;&scy;&kcy;&ocy;&gcy;&ocy; &ecy;&lcy;&iecy;&mcy;&iecy;&ncy;&tcy;&acy; B0, &kcy;&acy;&kcy; &icy; &tcy;&acy; &zhcy;&iecy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&acy; &bcy;&iecy;&zcy; &ocy;&pcy;&tscy;&icy;&icy;  <code>--fork-point</code> ). &dcy;&acy;&iecy;&tcy;).</span></p> <p><span data-i18n="fc729c4264a36be3f0269486c4e7347526ef3d0a225cb8e09536f7c39e9031d1/8a" data-source="Also, the remote-tracking branch you use the &lt;code&gt;--fork-point&lt;/code&gt; mode with must be the one your topic forked from its tip. If you forked from an older commit than the tip, this mode would not find the fork point (imagine in the above sample history B0 did not exist, origin/master started at B1, moved to B2 and then B, and you forked your topic at origin/master^ when origin/master was B1; the shape of the history would be the same as above, without B0, and the parent of B1 is what &lt;code&gt;git merge-base origin/master topic&lt;/code&gt; correctly finds, but the &lt;code&gt;--fork-point&lt;/code&gt; mode will not, because it is not one of the commits that used to be at the tip of origin/master)." onmousemove="i18n(this)">&Kcy;&rcy;&ocy;&mcy;&iecy; &tcy;&ocy;&gcy;&ocy;, &vcy;&iecy;&tcy;&vcy;&softcy; &ucy;&dcy;&acy;&lcy;&iecy;&ncy;&ncy;&ocy;&gcy;&ocy; &ocy;&tcy;&scy;&lcy;&iecy;&zhcy;&icy;&vcy;&acy;&ncy;&icy;&yacy;, &scy; &kcy;&ocy;&tcy;&ocy;&rcy;&ocy;&jcy; &vcy;&ycy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&iecy;&tcy;&iecy; &rcy;&iecy;&zhcy;&icy;&mcy;  <code>--fork-point</code> , &dcy;&ocy;&lcy;&zhcy;&ncy;&acy; &bcy;&ycy;&tcy;&softcy; &tcy;&ocy;&jcy;, &ocy;&tcy; &kcy;&ocy;&tcy;&ocy;&rcy;&ocy;&jcy; &vcy;&acy;&shcy;&acy; &tcy;&iecy;&mcy;&acy; &rcy;&acy;&zcy;&vcy;&icy;&lcy;&acy;&scy;&softcy;. &IEcy;&scy;&lcy;&icy; &vcy;&ycy; &vcy;&ycy;&pcy;&ocy;&lcy;&ncy;&icy;&lcy;&icy; &fcy;&ocy;&rcy;&kcy; &icy;&zcy; &bcy;&ocy;&lcy;&iecy;&iecy; &scy;&tcy;&acy;&rcy;&ocy;&gcy;&ocy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&acy;, &chcy;&iecy;&mcy; &scy;&ocy;&vcy;&iecy;&tcy;, &ecy;&tcy;&ocy;&tcy; &rcy;&iecy;&zhcy;&icy;&mcy; &ncy;&iecy; &ncy;&acy;&jcy;&dcy;&iecy;&tcy; &tcy;&ocy;&chcy;&kcy;&ucy; &fcy;&ocy;&rcy;&kcy;&acy; (&pcy;&rcy;&iecy;&dcy;&scy;&tcy;&acy;&vcy;&softcy;&tcy;&iecy;, &chcy;&tcy;&ocy; &vcy; &pcy;&rcy;&icy;&vcy;&iecy;&dcy;&iecy;&ncy;&ncy;&ocy;&mcy; &vcy;&ycy;&shcy;&iecy; &pcy;&rcy;&icy;&mcy;&iecy;&rcy;&iecy; &icy;&scy;&tcy;&ocy;&rcy;&icy;&icy; B0 &ncy;&iecy; &scy;&ucy;&shchcy;&iecy;&scy;&tcy;&vcy;&ocy;&vcy;&acy;&lcy;&ocy;, &icy;&scy;&tcy;&ocy;&chcy;&ncy;&icy;&kcy;/&mcy;&acy;&scy;&tcy;&iecy;&rcy; &ncy;&acy;&chcy;&icy;&ncy;&acy;&lcy;&scy;&yacy; &scy; B1, &pcy;&iecy;&rcy;&iecy;&mcy;&iecy;&shchcy;&acy;&lcy;&scy;&yacy; &vcy; B2, &acy; &zcy;&acy;&tcy;&iecy;&mcy; &vcy; B, &icy; &vcy;&ycy; &rcy;&acy;&zcy;&vcy;&iecy;&tcy;&vcy;&icy;&lcy;&icy; &scy;&vcy;&ocy;&yucy; &tcy;&iecy;&mcy;&ucy;. &vcy; origin/master^, &kcy;&ocy;&gcy;&dcy;&acy; origin/master &bcy;&ycy;&lcy; B1; &fcy;&ocy;&rcy;&mcy;&acy; &icy;&scy;&tcy;&ocy;&rcy;&icy;&icy; &bcy;&ucy;&dcy;&iecy;&tcy; &tcy;&acy;&kcy;&ocy;&jcy; &zhcy;&iecy;, &kcy;&acy;&kcy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;&ocy; &vcy;&ycy;&shcy;&iecy;, &bcy;&iecy;&zcy; B0, &acy; &rcy;&ocy;&dcy;&icy;&tcy;&iecy;&lcy;&softcy;&scy;&kcy;&icy;&mcy; &ecy;&lcy;&iecy;&mcy;&iecy;&ncy;&tcy;&ocy;&mcy; B1 &yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy; &tcy;&ocy;, &chcy;&tcy;&ocy;  <code>git merge-base origin/master topic</code>  &pcy;&rcy;&acy;&vcy;&icy;&lcy;&softcy;&ncy;&ocy; &ncy;&acy;&khcy;&ocy;&dcy;&icy;&tcy;, &ncy;&ocy; &rcy;&iecy;&zhcy;&icy;&mcy;  <code>--fork-point</code>  &ncy;&iecy; &bcy;&ucy;&dcy;&iecy;&tcy;, &pcy;&ocy;&tcy;&ocy;&mcy;&ucy; &chcy;&tcy;&ocy; &ocy;&ncy; &ncy;&iecy; &ocy;&dcy;&icy;&ncy; &kcy;&ocy;&mcy;&mcy;&icy;&tcy;&ocy;&vcy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &rcy;&acy;&ncy;&softcy;&shcy;&iecy; &ncy;&acy;&khcy;&ocy;&dcy;&icy;&lcy;&icy;&scy;&softcy; &ncy;&acy; &vcy;&iecy;&rcy;&shcy;&icy;&ncy;&iecy; &icy;&scy;&tcy;&ocy;&chcy;&ncy;&icy;&kcy;&acy;/&mcy;&acy;&scy;&tcy;&iecy;&rcy;&acy;).</span></p> </div> <h2 class="text-body-emphasis"  id="_see_also"><span data-i18n="2fa97693b70fa87b95b2d1bdf9558e4ac65d5e82d145f13a03849c4d9c4957a9/40" data-source="See also" onmousemove="i18n(this)">See also</span></h2> <div> <p><span data-i18n="489df9e9903b47481f9bd6b89db145a61e4007307560afef5ef4debe2c9db8d0/5d" data-source="&lt;a href=&quot;git-rev-list&quot;&gt;git-rev-list[1]&lt;/a&gt;, &lt;a href=&quot;git-show-branch&quot;&gt;git-show-branch[1]&lt;/a&gt;, &lt;a href=&quot;git-merge&quot;&gt;git-merge[1]&lt;/a&gt;" onmousemove="i18n(this)"><a href="git-rev-list.html">git-rev-list[1]</a> ,  <a href="git-show-branch.html">git-show-branch[1]</a> ,  <a href="git-merge.html">git-merge[1]</a></span></p> </div><address>
<p>
    &copy; 2012&ndash;2024 Scott Chacon and others<br/>Licensed under the MIT License.<br/>
<a href="https://git-scm.com/docs/git-merge-base">https://git-scm.com/docs/git-merge-base</a>
</p>
</address>                </article>
            </main>

            <br>
            <br>
            <hr>

                               <ins class="adsbygoogle"
        style="display:block"
        data-ad-format="autorelaxed"
        data-ad-client="ca-pub-6424571640879890"
        data-ad-slot="7867651344"></ins>
   <script>
        (adsbygoogle = window.adsbygoogle || []).push({});
   </script>            
        </div>

        <!-- -->

        <div class="col-md-3">
            <br>
            <form action="-index-.html">
                <div class="input-group">
                    <input class="form-control" type="search" name="q" placeholder="Search for Git" required>
                    <button class="btn btn-primary" type="submit">
                        <i class="bi bi-search"></i>
                    </button>
                </div>
            </form>
            <br>

                            <div class="list-group list-group-flush">
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-merge-file.html">
                            git merge-file                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-merge-index.html">
                            git merge-index                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-merge-one-file.html">
                            git merge-one-file                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-merge-tree.html">
                            git merge-tree                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-mergetool.html">
                            git mergetool                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-mktag.html">
                            git mktag                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="git-mktree.html">
                            git mktree                        </a>
                                    </div>
            
            <br>
            <div class="my-3">
                <ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-6424571640879890"
     data-ad-slot="3954319254"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>            </div>
            <br>

            
            
        </div>
    </div>
</div>    <!--/sse-->

    <footer>
        <br>
        <div class="container">
            <div class="row">
                <div class="col">
                    <hr>
                    <div class="row">
                        <div class="col-md-10">
                            <ul class="nav">
                                <li class="nav-item">
                                    <a class="nav-link ps-0" href="https://runebook.dev/">Help us Improve Translation</a>
                                </li>
                                                            </ul>
                        </div>
                        <div class="col-md-2 text-end">
                            <a href="git-merge-base.html#" class="fs-5" aria-label="Top">
                                <i class="bi bi-arrow-up-square-fill"></i>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <br>
    </footer>
    <script src="../../../runebook.js"></script>
</body>

</html>